package com.qst.crop.dao;

import com.qst.crop.entity.FinancingIntention;
import com.qst.crop.entity.RecommendVO;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface FinancingIntentionDao {
    @Select("select * from tb_financing_intention where user_name = #{name}")
    List<FinancingIntention> selectByName(String name);

    @Delete("delete from tb_financing_intention where user_name =#{name}")
    void deleteByName(String username);

    @Insert("insert into tb_financing_intention(user_name, real_name, address, amount, application, item, repayment_period, area, phone, create_time, update_time) " +
            "VALUES (#{userName}, #{realName}, #{address}, #{amount}, #{application},#{item},#{repaymentPeriod},#{area},#{phone},#{createTime},#{updateTime})")
    void insertIntension(FinancingIntention financingIntention);

    @Update("update tb_financing_intention set real_name = #{realName} ,address = #{address},amount = #{amount},application = #{application},item = #{item},repayment_period = #{repaymentPeriod},area = #{area},phone = #{phone},update_time = #{updateTime} where user_name = #{userName}")
    void updateIntensionByName(FinancingIntention financingIntention);

    List<RecommendVO> selectWithNoneIntention(String name);

    List<RecommendVO> selectAll(String name);
}
